﻿@{
	Layout = "TPageQuery";



}
@section queryForm
	{


	<ul>
		<li>
			<label>菜单名称:</label>
			<input class="qtextbox easyui-textbox " id="text" name="text">
		</li>

	</ul>


}

<table id="dg"></table>
@section Scripts{
	<script>

		QTools.AddModel = function () {
			G.openDlg("/SystemManager/SystemMenu/SystemMenuEdit", "新增菜单数据", 40, 50)
		}
		QTools.UpdateModel = function () {
			let row = G.getSelectRows("dg");
			G.openDlg("/SystemManager/SystemMenu/SystemMenuEdit?Id=" + row.Id, "修改菜单数据", 40, 50)
		}
		QTools.QueryModel = function () {
			let url = '/SystemManager/SystemMenu/SystemMenuQuery?' + $("#queryForm").serialize();
			$("#dg").treegrid({ url: url });
		}


		$(() => {

			$('#dg').treegrid({

				url: '/SystemManager/SystemMenu/SystemMenuQuery?' + $("#queryForm").serialize(),
				idField: 'Id',
				treeField: 'text',
				rownumbers: true,
				fitColumns: true,
				height: G.fixHeight(0.9, 40),
				columns: [[
					{ field: 'text', title: '名称', width: 100 },
					{ field: 'Area', title: '域名', width: 80, },
					{ field: 'Controller', title: '控制器', width: 80 },
					{ field: 'ActionName', title: '方法', width: 80 }
				]],

				onLoadSuccess: function (row, data) {
					if (data && data.length > 0) {
						$(this).treegrid('expand', data[0].id)
					}
				}



			})






		})





	</script>
}